package org.jcut.controller;

import javax.annotation.Resource;

import org.jcut.bean.Admin;
import org.jcut.data.Data;
import org.jcut.service.IAdminService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController

@RequestMapping("/admin")
public class AdminController {
	@Resource
	private Data data;
	@Resource
	private IAdminService service;
	@RequestMapping("/login")
	public Object login(Admin admin) {
		long i=service.login(admin);
		if(i>0) {
			data.setData("登录成功");
			data.setMsg("登录成功");
			data.setStatus("1");
		}else {
			data.setData("登录失败");
			data.setMsg("登录失败");
			data.setStatus("0");
		}
		return data;
	}
}
